import request from "@/utils/request";

export function getPurchaseReceipts(paramters) {
  return request({
    url: "api/v1/inventories/purchase-receipts",
    method: "get",
    params: paramters,
    businessServer: true,
  });
}

export function getPurchaseReceipt(id) {
  return request({
    url: "api/v1/inventories/purchase-receipts/" + id,
    method: "get",
    businessServer: true,
  });
}

export function addPurchaseReceipt(data) {
  return request({
    url: "api/v1/inventories/purchase-receipts",
    method: "post",
    data: data,
    businessServer: true,
  });
}

export function updatePurchaseReceipt(data) {
  return request({
    url: "api/v1/inventories/purchase-receipts",
    method: "put",
    data: data,
    businessServer: true,
  });
}

export function updatePurchaseReceiptStatus(id, status) {
  return request({
    url: "api/v1/inventories/purchase-receipts/" + id + "/status/" + status,
    method: "put",
    data: {},
    businessServer: true,
  });
}

export function deletePurchaseReceipt(id) {
  return request({
    url: "api/v1/inventories/purchase-receipts/" + id,
    method: "delete",
    businessServer: true,
  });
}